package edu.uts.reekie.designer.implementation;

import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.palette.PaletteRoot;

import edu.uts.reekie.designer.AbstractContextMenuProvider;
import edu.uts.reekie.designer.AbstractViewEditor;
import edu.uts.reekie.designer.implementation.actions.ChangeConnectorHasPortAction;
import edu.uts.reekie.designer.implementation.actions.SetConnectorStyleAction;
import edu.uts.reekie.designer.implementation.edit.ViewPartFactory;
import edu.uts.reekie.designer.implementation.model.ViewDiagram;
import edu.uts.reekie.designer.model.AbstractDiagram;

public class VE extends AbstractViewEditor {


	@Override
	protected  void registerComponentActions(){
		
	}
	
	@Override
	protected void registerConnectorActions() {
		// register all the connector decoration actions
		for (SetConnectorStyleAction.Factory f: SetConnectorStyleAction.all().values()){
			registerAction(f.createAction(this));
		}
		for (ChangeConnectorHasPortAction.Factory f: ChangeConnectorHasPortAction.all().values()){
			registerAction(f.createAction(this));
		}
	}

	@Override
	protected AbstractContextMenuProvider createContextMenuProvider(EditPartViewer viewer) {
		return new ContextMenuProvider(viewer, getActionRegistry());
		
	}

	@Override
	protected AbstractDiagram createDiagram() {
		return new ViewDiagram();
	}

	@Override
	protected EditPartFactory createEditPartFactory() {
		return new ViewPartFactory();
	}

	@Override
	protected PaletteRoot createPaletteRoot() {
		
		return new ViewPaletteFactory().createPalette();
	}
	protected void createActions() {
		super.createActions();
	}

}
